package com.gitee.wsl.mathematics.geometry.api

import com.gitee.wsl.mathematics.coordinate.Coordinate
import com.gitee.wsl.mathematics.vector.Vector
import com.gitee.wsl.unit.angle.AngleUnit

interface LineShape<T:Number,V: Coordinate<T, V>>: Shape<T, V> {

     val a: V get() = proxy[0]
     val b: V get() = proxy[1]

    override val center: V
        get() = (a + b)/2

    fun flipped() = create(b, a)

    val angle: AngleUnit
    val length: T
    val lengthSquared: T

    val x0: T
    val y0: T
    val x1: T
    val y1: T
    val dx: T
    val dy: T

    val minX: T
    val minY: T

    val maxX: T
    val maxY: T

    fun create(a:V,b:V):LineShape<T,V>

    fun directionVector(): Vector<T, *>

}
